<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>招募</title>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">


</head>
<body>
<div id="recuit">
    <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="姓名">
            <el-input v-model="form.name" style="width: 300px;height: 50px"></el-input>
        </el-form-item>
        <el-form-item label="年龄">
            <el-input v-model="form.age" style="width: 300px;height: 50px"></el-input>
        </el-form-item>
        <el-form-item label="身份证号">
            <el-input v-model="form.personid" style="width: 300px;height: 50px"></el-input>
        </el-form-item>
        <el-form-item label="性别">
            <el-radio-group v-model="form.sex">
                <el-radio label="男"></el-radio>
                <el-radio label="女"></el-radio>
            </el-radio-group>
        </el-form-item>
        <el-form-item label="学历">
            <el-select v-model="form.degree" placeholder="请选择本人学历">
                <el-option label="小学" value="小学"></el-option>
                <el-option label="初中" value="初中"></el-option>
                <el-option label="高中/中专" value="高中/中专"></el-option>
                <el-option label="专科" value="专科"></el-option>
                <el-option label="本科" value="本科"></el-option>
                <el-option label="硕士" value="硕士"></el-option>
                <el-option label="博士" value="博士"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="电话">
            <el-input type="textarea" v-model="form.phone" style="width: 300px;height: 50px"></el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="onSubmit">立即申请</el-button>
            <el-button>重置</el-button>
        </el-form-item>
    </el-form>
</div>

<script src="../js/vue.js"></script>
<script src="../js/axios.min.js"></script>
<script src="../js/element-ui/index.js"></script>
<script>
    new Vue({
        el:'#recuit',
        data() {
            return {
                form: {
                    name: '',
                    age: '',
                    personid: '',
                    sex: '',
                    degree: '',
                    phone: ''
                }
            }
        },
        methods: {
            onSubmit() {
                axios.post('/onSubmit',this.form)
                .then(response=>{
                    let code = response.data.code
                    let message = respons.data.message
                    if (code == 200){
                        this.$message({showClose: true,message: message,type: 'success'});
                    }else {
                        this.$message({showClose: true, message: message, type: 'error'});
                    }
                })
            }
        }
    })
</script>
</body>
</html>